home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UTIL / SCREEN / CURSES01 / minix / c / attrib next >
Text File  |  1991-05-05  |  5KB  |  144 lines

  1. /****************************************************************/
  2. /* Character attribute routines of the PCcurses package        */
  3. /*                                */
  4. /****************************************************************/
  5. /* This version of curses is based on ncurses, a curses version    */
  6. /* originally written by Pavel Curtis at Cornell University.    */
  7. /* I have made substantial changes to make it run on IBM PC's,    */
  8. /* and therefore consider myself free make it public domain.    */
  9. /*        Bjorn Larsson (...mcvax!enea!infovax!bl)    */
  10. /****************************************************************/
  11. /* 1.0:    Release:                    870515    */
  12. /****************************************************************/
  13. /* Modified to run under the MINIX operating system by Don Cope */
  14. /* These changes are also released into the public domain.      */
  15. /*                             900906  */
  16. /****************************************************************/
  17.  
  18. #include <curses.h>
  19. #include "curspriv.h"
  20.  
  21. /****************************************************************/
  22. /* Wattrset() sets the attributes as specified in window 'win'.    */
  23. /****************************************************************/
  24.  
  25. void wattrset(win,attrs)
  26.   WINDOW    *win;
  27.   int         attrs;
  28.   {
  29.   win->_attrs = attrs & ATR_MSK;
  30.   } /* wattrset */
  31.  
  32. /****************************************************************/
  33. /* Wattron() sets the specified attribute(s) in window 'win'.    */
  34. /****************************************************************/
  35.  
  36. void    wattron(win,attrs)
  37.   WINDOW    *win;
  38.   int         attrs;
  39.   {
  40.       win->_attrs |= (attrs & ATR_MSK);
  41.   } /* wattron */
  42.  
  43. /****************************************************************/
  44. /* Wattroff() clears the specified attribute(s) in window    */
  45. /* 'win'.                            */
  46. /****************************************************************/
  47.  
  48. void    wattroff(win,attrs)
  49.   WINDOW    *win;
  50.   int         attrs;
  51.   {
  52.   win->_attrs &= (~attrs & ATR_MSK);
  53.   } /* wattroff */
  54.  
  55. /****************************************************************/
  56. /* Wstandout() starts standout mode in window 'win'.        */
  57. /****************************************************************/
  58.  
  59. void    wstandout(win)
  60.   WINDOW    *win;
  61.   {
  62.   win->_attrs |= A_STANDOUT;
  63.   } /* wstandout */
  64.  
  65. /****************************************************************/
  66. /* Wstandend() clears all special attributes in window 'win'.    */
  67. /****************************************************************/
  68.  
  69. void    wstandend(win)
  70.   WINDOW    *win;
  71.   {
  72.   win->_attrs &= ~A_STANDOUT;
  73.   } /* wstandend */
  74.  
  75. /****************************************************************/
  76. /* wcolors() set the forground and background window colors     */
  77. /****************************************************************/
  78. void  wsetcolors(win, screen)
  79.   WINDOW    *win;
  80.   int       screen;
  81.   {
  82.   win->_colors = ((screen & 0xf000) >> 12) | (screen & 0xf00); 
  83.   win->_attrs |= 0x8000;
  84. /*  _cursessetcolor(win->_colors); */
  85.   }
  86.  
  87. /****************************************************************/
  88. /* Attrset() sets the attributes as specified in stdscr.    */
  89. /****************************************************************/
  90.  
  91. void    attrset(attrs)
  92.   int attrs;
  93.   {
  94.   stdscr->_attrs = attrs & ATR_MSK;
  95.   } /* attrset */
  96.  
  97. /****************************************************************/
  98. /* Attron() sets the specified attribute(s) in stdscr.        */
  99. /****************************************************************/
  100.  
  101. void    attron(attrs)
  102.   int         attrs;
  103.   {
  104.   stdscr->_attrs |= (attrs & ATR_MSK);
  105.   } /* attron */
  106.  
  107. /****************************************************************/
  108. /* Attroff() clears the specified attribute(s) in stdscr.    */
  109. /****************************************************************/
  110.  
  111. void    attroff(attrs)
  112.   int         attrs;
  113.   {
  114.   stdscr->_attrs &= (~attrs & ATR_MSK);
  115.   } /* attroff */
  116.  
  117. /****************************************************************/
  118. /* Standout() starts standout mode in stdscr.            */
  119. /****************************************************************/
  120.  
  121. void    standout()
  122.   {
  123.   stdscr->_attrs = A_STANDOUT;
  124.   } /* standout */
  125.  
  126. /****************************************************************/
  127. /* Standend() clears all special attributes in stdscr.        */
  128. /****************************************************************/
  129.  
  130. void    standend()
  131.   {
  132.   stdscr->_attrs &= ~A_STANDOUT;
  133.   } /* standend */
  134.  
  135. /****************************************************************/
  136. /* setcolors() set the forground and background window colors   */
  137. /*           of stdscr                                            */
  138. /****************************************************************/
  139. void  setcolors(fore, back)
  140.   int       fore, back;
  141.   {
  142.    wsetcolors(stdscr, fore, back);
  143.   }
  144.